import { DeptItem, DeptType, DictTypeCode } from "/@/api/main/system/models";
import { SelectOptionItem } from "/@/types/antd";

export type TabKey = "company" | "cooperation" | "category" | "region";

export interface TabItem {
  loading: boolean;
  data: SelectOptionItem[] | DeptItem[];
  authData: SelectOptionItem[] | DeptItem[];
  key: TabKey;
  name: string;
  fieldNames: { title: string; key: string };
  type: DeptType | DictTypeCode;
  checkedKeys: number[];
}

export function getTabData(): TabItem[] {
  return [
    {
      key: "company",
      loading: false,
      data: [],
      name: "公司架构",
      fieldNames: { title: "name", key: "id" },
      type: DeptType.company,
      checkedKeys: [],
      authData: [],
    },
    {
      key: "cooperation",
      loading: false,
      data: [],
      name: "合作框架",
      fieldNames: { title: "name", key: "id" },
      type: DeptType.cooperation,
      checkedKeys: [],
      authData: [],
    },
    {
      key: "category",
      loading: false,
      data: [],
      name: "商品类别",
      fieldNames: { title: "label", key: "value" },
      type: DictTypeCode.productCategory,
      checkedKeys: [],
      authData: [],
    },
    {
      key: "region",
      loading: false,
      data: [],
      name: "行政区域",
      fieldNames: { title: "label", key: "value" },
      type: DictTypeCode.region,
      checkedKeys: [],
      authData: [],
    },
  ];
}
